package com.hz.dao;

import com.hz.pojo.Recharge;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 充值表
 */
@Repository
public interface RechargeDao {
    /**
     * 111
     * 根据用户id查询用户对应的充值记录
     * @param recharge_user_id
     * @return 返回充值记录的集合
     * @throws Exception
     */
    public abstract List<Recharge> getRechargeList(@Param("recharge_user_id") String recharge_user_id) throws Exception;

    /**
     * 插入用户充值信息
     * @param recharge_user_id  用户open_id
     * @param recharge_money    充值金额
     * @param recharge_time
     * @return
     * @throws Exception
     */
    public abstract int addRecharge(@Param("recharge_user_id") String recharge_user_id,@Param("recharge_money") Double recharge_money, @Param("recharge_time")String recharge_time) throws  Exception;

    /**
     * 更改充值之后的账户余额
     * @param open_id     充值的账户id
     * @param money        充值的钱
     * @return
     */
    public abstract int udpUserBalance(@Param("open_id")String open_id,@Param("money")Double money);

}
